package com.boronstream.istar.model;

import java.util.Iterator;

import org.json.JSONException;
import org.json.JSONObject;

public class Horoscope extends PlayObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String star_name;
	private String overview_index;
	private String overview_desc;
	private String love_index;
	private String love_desc;
	private String health_index;
	private String health_desc;
	private String work_index;
	private String work_desc;
	private String wealth_index;
	private String wealth_desc;
	private String lucky_color;
	private String lucky_number;
	private String fast_match;
	private String description;
	private String update_time;

	public Horoscope(JSONObject jsonObject) {
		try {
			Iterator<String> keys = jsonObject.keys();
			while (keys.hasNext()) {
				String key = keys.next();
				this.initParamWithJsonAndKey(jsonObject, key);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public String getStar_name() {
		return star_name;
	}

	public void setStar_name(String star_name) {
		this.star_name = star_name;
	}

	public String getOverview_index() {
		return overview_index;
	}

	public void setOverview_index(String overview_index) {
		this.overview_index = overview_index;
	}

	public String getOverview_desc() {
		return overview_desc;
	}

	public void setOverview_desc(String overview_desc) {
		this.overview_desc = overview_desc;
	}

	public String getLove_index() {
		return love_index;
	}

	public void setLove_index(String love_index) {
		this.love_index = love_index;
	}

	public String getLove_desc() {
		return love_desc;
	}

	public void setLove_desc(String love_desc) {
		this.love_desc = love_desc;
	}

	public String getHealth_index() {
		return health_index;
	}

	public void setHealth_index(String health_index) {
		this.health_index = health_index;
	}

	public String getHealth_desc() {
		return health_desc;
	}

	public void setHealth_desc(String health_desc) {
		this.health_desc = health_desc;
	}

	public String getWork_index() {
		return work_index;
	}

	public void setWork_index(String work_index) {
		this.work_index = work_index;
	}

	public String getWork_desc() {
		return work_desc;
	}

	public void setWork_desc(String work_desc) {
		this.work_desc = work_desc;
	}

	public String getWealth_index() {
		return wealth_index;
	}

	public void setWealth_index(String wealth_index) {
		this.wealth_index = wealth_index;
	}

	public String getWealth_desc() {
		return wealth_desc;
	}

	public void setWealth_desc(String wealth_desc) {
		this.wealth_desc = wealth_desc;
	}

	public String getLucky_color() {
		return lucky_color;
	}

	public void setLucky_color(String locky_color) {
		this.lucky_color = locky_color;
	}

	public String getLucky_number() {
		return lucky_number;
	}

	public void setLucky_number(String locky_number) {
		this.lucky_number = locky_number;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getUpdate_time() {
		return update_time;
	}

	public void setUpdate_time(String update_time) {
		this.update_time = update_time;
	}

	public String getFast_match() {
		return fast_match;
	}

	public void setFast_match(String fast_match) {
		this.fast_match = fast_match;
	}

	@Override
	public String toString() {
		return "Horoscope [star_name=" + star_name + ", overview_index="
				+ overview_index + ", overview_desc=" + overview_desc
				+ ", love_index=" + love_index + ", love_desc=" + love_desc
				+ ", health_index=" + health_index + ", health_desc="
				+ health_desc + ", work_index=" + work_index + ", work_desc="
				+ work_desc + ", wealth_index=" + wealth_index
				+ ", wealth_desc=" + wealth_desc + ", lucky_color="
				+ lucky_color + ", lucky_number=" + lucky_number
				+ ", fast_match=" + fast_match + ", description=" + description
				+ ", update_time=" + update_time + "]";
	}

	@Override
	public void initParamWithJsonAndKey(JSONObject jsonObject,
			String key) throws JSONException {
		if ("star_name".equals(key)) {
			this.setStar_name(jsonObject.getString(key));
		}
		if ("overview_index".equals(key)) {
			this.setOverview_index(jsonObject.getString(key));
		}
		if ("overview_desc".equals(key)) {
			this.setOverview_desc(jsonObject.getString(key));
		}
		if ("overview_index".equals(key)) {
			this.setOverview_index(jsonObject.getString(key));
		}
		if ("love_index".equals(key)) {
			this.setLove_index(jsonObject.getString(key));
		}
		if ("love_desc".equals(key)) {
			this.setLove_desc(jsonObject.getString(key));
		}
		if ("health_index".equals(key)) {
			this.setHealth_index(jsonObject.getString(key));
		}
		if ("health_desc".equals(key)) {
			this.setHealth_desc(jsonObject.getString(key));
		}
		if ("work_index".equals(key)) {
			this.setWork_index(jsonObject.getString(key));
		}
		if ("work_desc".equals(key)) {
			this.setWork_desc(jsonObject.getString(key));
		}
		if ("wealth_index".equals(key)) {
			this.setWealth_index(jsonObject.getString(key));
		}
		if ("wealth_desc".equals(key)) {
			this.setWealth_desc(jsonObject.getString(key));
		}
		if ("lucky_color".equals(key)) {
			this.setLucky_color(jsonObject.getString(key));
		}
		if ("lucky_number".equals(key)) {
			this.setLucky_number(jsonObject.getString(key));
		}
		if ("fast_match".equals(key)) {
			this.setFast_match(jsonObject.getString(key));
		}
		if ("description".equals(key)) {
			this.setDescription(jsonObject.getString(key));
		}
		if ("update_time".equals(key)) {
			this.setUpdate_time(jsonObject.getString(key));
		}
	}

}
